package com.fish.anne.model;

import com.fish.anne.model.BaseObject;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

import java.io.Serializable;

@Entity
@Table(name="member_level" )
public class MemberLevel extends BaseObject implements Serializable {
    private Long levelId;
    private String name;
    private Long disCount;
    private boolean defaultLevel;
    private Long depositFreezeTime;
    private Long deposit;
    private Long morePoint;
    private Long point;
    private boolean showOtherPrice;
    private byte orderLimit;
    private Long orderLimitPrice;

    @Id   @GeneratedValue(strategy = GenerationType.AUTO)    
    public Long getLevelId() {
        return this.levelId;
    }
    
    public void setLevelId(Long levelId) {
        this.levelId = levelId;
    }
    
    @Column(name="name", nullable=false, length=100)
    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    @Column(name="dis_count", nullable=false)
    public Long getDisCount() {
        return this.disCount;
    }
    
    public void setDisCount(Long disCount) {
        this.disCount = disCount;
    }
    
    @Column(name="default_level", nullable=false)
    public boolean isDefaultLevel() {
        return this.defaultLevel;
    }
    
    public void setDefaultLevel(boolean defaultLevel) {
        this.defaultLevel = defaultLevel;
    }
    
    @Column(name="deposit_freeze_time", nullable=false)
    public Long getDepositFreezeTime() {
        return this.depositFreezeTime;
    }
    
    public void setDepositFreezeTime(Long depositFreezeTime) {
        this.depositFreezeTime = depositFreezeTime;
    }
    
    @Column(name="deposit", nullable=false)
    public Long getDeposit() {
        return this.deposit;
    }
    
    public void setDeposit(Long deposit) {
        this.deposit = deposit;
    }
    
    @Column(name="more_point", nullable=false)
    public Long getMorePoint() {
        return this.morePoint;
    }
    
    public void setMorePoint(Long morePoint) {
        this.morePoint = morePoint;
    }
    
    @Column(name="point", nullable=false)
    public Long getPoint() {
        return this.point;
    }
    
    public void setPoint(Long point) {
        this.point = point;
    }
    
    @Column(name="show_other_price", nullable=false)
    public boolean isShowOtherPrice() {
        return this.showOtherPrice;
    }
    
    public void setShowOtherPrice(boolean showOtherPrice) {
        this.showOtherPrice = showOtherPrice;
    }
    
    @Column(name="order_limit", nullable=false)
    public byte getOrderLimit() {
        return this.orderLimit;
    }
    
    public void setOrderLimit(byte orderLimit) {
        this.orderLimit = orderLimit;
    }
    
    @Column(name="order_limit_price", nullable=false)
    public Long getOrderLimitPrice() {
        return this.orderLimitPrice;
    }
    
    public void setOrderLimitPrice(Long orderLimitPrice) {
        this.orderLimitPrice = orderLimitPrice;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MemberLevel pojo = (MemberLevel) o;

        if (name != null ? !name.equals(pojo.name) : pojo.name != null) return false;
        if (disCount != null ? !disCount.equals(pojo.disCount) : pojo.disCount != null) return false;
        if (defaultLevel != pojo.defaultLevel) return false;
        if (depositFreezeTime != null ? !depositFreezeTime.equals(pojo.depositFreezeTime) : pojo.depositFreezeTime != null) return false;
        if (deposit != null ? !deposit.equals(pojo.deposit) : pojo.deposit != null) return false;
        if (morePoint != null ? !morePoint.equals(pojo.morePoint) : pojo.morePoint != null) return false;
        if (point != null ? !point.equals(pojo.point) : pojo.point != null) return false;
        if (showOtherPrice != pojo.showOtherPrice) return false;
         if (orderLimitPrice != null ? !orderLimitPrice.equals(pojo.orderLimitPrice) : pojo.orderLimitPrice != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (name != null ? name.hashCode() : 0);
        result = 31 * result + (disCount != null ? disCount.hashCode() : 0);
        result = 31 * result + (defaultLevel ? 1 : 0);
        result = 31 * result + (depositFreezeTime != null ? depositFreezeTime.hashCode() : 0);
        result = 31 * result + (deposit != null ? deposit.hashCode() : 0);
        result = 31 * result + (morePoint != null ? morePoint.hashCode() : 0);
        result = 31 * result + (point != null ? point.hashCode() : 0);
        result = 31 * result + (showOtherPrice ? 1 : 0);
         result = 31 * result + (orderLimitPrice != null ? orderLimitPrice.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("levelId").append("='").append(getLevelId()).append("', ");
        sb.append("name").append("='").append(getName()).append("', ");
        sb.append("disCount").append("='").append(getDisCount()).append("', ");
        sb.append("defaultLevel").append("='").append(isDefaultLevel()).append("', ");
        sb.append("depositFreezeTime").append("='").append(getDepositFreezeTime()).append("', ");
        sb.append("deposit").append("='").append(getDeposit()).append("', ");
        sb.append("morePoint").append("='").append(getMorePoint()).append("', ");
        sb.append("point").append("='").append(getPoint()).append("', ");
        sb.append("showOtherPrice").append("='").append(isShowOtherPrice()).append("', ");
        sb.append("orderLimit").append("='").append(getOrderLimit()).append("', ");
        sb.append("orderLimitPrice").append("='").append(getOrderLimitPrice()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
